package com.uplooking.util;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.uplooking.daomain.UserBean;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ArrayListHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.List;

public class C3p0Jdbc {
    public QueryRunner getConn(){
        //创建C3p0连接池对象select * from user
        DataSource dataSource = new ComboPooledDataSource();
        //使dbutil连接数据库
        QueryRunner queryRunner = new QueryRunner(dataSource);
        return queryRunner;
    }




}
